{include file="steps/headStep.tpl"}

<h2 class="bigger">Escolha o Tipo de Formulário dos Relacionamentos</h2>

{foreach $tablesMeta as $table}
    {if count($table->getFKReferences()) > 0}

        <div class="block-content">

            {$tbName = $table->getName()|capitalize}

            <h1>{$tbName}</h1>

            <table class="table" cellspacing="0" width="100%">
                <thead>
                    <tr>
                        <th scope="col">Tabela Referenciada</th>
                        <th scope="col">Tipo de Formulário</th>
                    </tr>
                </thead>

                {foreach $table->getFKReferences() as $fk}
                   
                   <tr>
                        <td>{$fk->getTableReference()->getName()|capitalize}</td>
                        <td>
                            
                            <select name="{$table->getName()}:{$fk->getName()}">
                                <option value="combo" {if strcmp($fk->getTypeForm(),"combo") == 0} selected="true" {/if}>ComboBox</option>
                                <option value="hidID" {if strcmp($fk->getTypeForm(),"hidID") == 0} selected="true" {/if}>Input Hidden ID</option>
                                <option value="form" {if strcmp($fk->getTypeForm(),"form") == 0} selected="true" {/if}>Incluir Formulário</option>
                                <option value="no" {if strcmp($fk->getTypeForm(),"no") == 0} selected="true" {/if}
                                        title="Lembre de Recuperar o Objeto ({$fk->getTableReference()->getName()|capitalize}) em {$tbName}Action.salvar">Nenhum</option>
                            </select>                            
                        </td>
                   </tr>
                   
                {/foreach}

            </table>
        </div>
    {/if}
{/foreach}